package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.O2oOrderMapper;
import com.aidex.biz.domain.O2oOrder;
import com.aidex.biz.service.O2oOrderService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 团购预约Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-10-19
 */
@Service
@Transactional(readOnly = true)
public class O2oOrderServiceImpl extends BaseServiceImpl<O2oOrderMapper, O2oOrder> implements O2oOrderService
{
    private static final Logger log = LoggerFactory.getLogger(O2oOrderServiceImpl.class);

    /**
     * 获取单条数据
     * @param o2oOrder 团购预约
     * @return 团购预约
     */
    @Override
    public O2oOrder get(O2oOrder o2oOrder)
    {
        O2oOrder dto = super.get(o2oOrder);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 团购预约id
     * @return 团购预约
     */
    @Override
    public O2oOrder get(String id)
    {
        O2oOrder dto = super.get(id);
        return dto;
    }


    /**
     * 查询团购预约列表
     * @param o2oOrder 团购预约
     * @return 团购预约
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<O2oOrder> findList(O2oOrder o2oOrder)
    {
        return super.findList(o2oOrder);
    }

    /**
     * 分页查询团购预约列表
     * @param o2oOrder 团购预约
     * @return 团购预约
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<O2oOrder> findPage(O2oOrder o2oOrder)
    {
        return super.findPage(o2oOrder);
    }

    /**
     * 保存团购预约
     * @param o2oOrder
     * @return 结果
     */
    @Override
    public boolean save(O2oOrder o2oOrder)
    {
        return super.save(o2oOrder);
    }


    /**
     * 删除团购预约信息
     * @param o2oOrder
     * @return 结果
     */
    @Override
    public boolean remove(O2oOrder o2oOrder)
    {
        return super.remove(o2oOrder);
    }

    /**
     * 批量删除团购预约
     * @param ids 需要删除的团购预约ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteO2oOrderByIds(String[] ids)
    {
        return mapper.deleteO2oOrderByIds(ids);
    }

    /**
     * 获取最大编号
     * @param o2oOrder 团购预约
     * @return 结果
     */
    @Override
    public int findMaxSort(O2oOrder o2oOrder)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(o2oOrder));
    }
}
